function searchKeyword($btn,$input){
    $btn.on("click",function () {
        var content = $input.val();
        if(content != ""){
            location.href="/commodity/list/"+encodeURI(content);
        }else{
            location.href="/commodity/list";
        }
    });
}
/**
 * 搜索提示框
 * @param $q
 * @param $show
 */
function tip($q,$show,$btn){
    $($q).bind('input propertychange', function(){
        if($(this).val()){
            $.ajax({
                async : false,
                type: "GET",
                url : "/commodity/keyword/"+$q.val(),
                success : function (data) {
                    $show.empty();
                    $.each(data,function (index,element) {
                        $("<div></div>").html(element).appendTo($show);
                    });
                    $show.fadeIn(100);

                },
                dataType : "JSON"
            });
        }else{
            $show.fadeOut(100);
        }
    });
    $($show).on("click","div",function () {
        $($q).val($(this).html());
        $show.fadeOut(100);
        $btn.click();
    });
}